#include "../src/mpegPlayer.hpp"
#include <iostream>
#include <filesystem>
#include <stdexcept>
#include <unistd.h>

int main()
{
  gst_init(nullptr,nullptr);
  if(!std::filesystem::exists("test.mp4"))
    throw std::runtime_error("无法打开test.mp4");
  MPEGPlayer player;
  player.funcNewImageCallback=[](const char*,int,int){
    std::cout<<"Get New Image"<<std::endl;
  };
  player.Start("test.mp4",true);
  sleep(2000);
  return 0;
}
